import {defineStore} from 'pinia'
import {ref} from 'vue'

export const useAuthStore = defineStore('auth',()=>{
    const token = ref('')

    const setToken = (t: string) => {
        token.value = t
    }

    const removeToken = () => {
        localStorage.removeItem('auth')
    }
    return {token, setToken, removeToken}
},{
    persist: true
})